package com.example.poverty.service.impl;

import com.example.poverty.dao.VillagersMessageMapper;
import com.example.poverty.entity.VillagersMessage;
import com.example.poverty.service.VillagersMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 前端 村民留言 接口实现类
 */
@Service
public class VillagersMessageServiceImpl implements VillagersMessageService {

    @Autowired
    private VillagersMessageMapper villagersMessageMapper;

    @Override
    public boolean insert(VillagersMessage villagersMessage) {
        return villagersMessageMapper.insert(villagersMessage) > 0;
    }

    @Override
    public boolean update(VillagersMessage villagersMessage) {
        return villagersMessageMapper.update(villagersMessage) > 0;
    }

    @Override
    public boolean delete(Integer id) {
        return villagersMessageMapper.delete(id) > 0;
    }

    @Override
    public VillagersMessage selectByPrimaryKey(Integer id) {
        return villagersMessageMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<VillagersMessage> allVillagersMessage() {
        return villagersMessageMapper.allVillagersMessage();
    }

    @Override
    public VillagersMessage getByName(String name) {
        return villagersMessageMapper.getByName(name);
    }
}
